package com.nut.lmsc.api.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.nut.lmsc.api.req.MemberCouponQueryReq;
import com.nut.lmsc.common.Result;
import com.nut.lmsc.entity.MemberCoupon;
import com.nut.lmsc.service.MemberCouponService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("/admin/memberCoupon")
public class MemberCouponController {

    @Autowired
    private MemberCouponService memberCouponService;

    @GetMapping("/listPage")
    public Result<IPage<MemberCoupon>> listPage(MemberCouponQueryReq req) {
        return memberCouponService.listPage(req);
    }

    @GetMapping(value = "/{id}")
    public Result<MemberCoupon> detail(@PathVariable Integer id) {
        return memberCouponService.getById(id);
    }

}